import type { PatientItem, PatientParams } from "@/types/patient"
import { request } from "@/utils/http"

// 添加患者（家庭档案）
export const addPatientApi = (data: PatientParams) => {
  return request.post<null>("/patient/add", data)
}

// 获取患者（家庭档案）列表
export const getPatientListApi = () => {
  return request.get<null, PatientItem[]>("/patient/mylist")
}

// 删除患者信息
export const delPatientApi = (id: string) => {
  return request.delete<null>(`/patient/del/${id}`)
}

// 查询患者详情
export const getPatientDetailApi = (id: string) => {
  return request.get<null, PatientItem>(`/patient/info/${id}`)
}

// 编辑患者信息
export const updatePatientApi = (data: PatientParams) => {
  return request.put<null>("/patient/update", data)
}
